<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  <title>个人中心</title>
  <link rel="stylesheet" type="text/css" href="__PUBLIC__/style/Course/common.css">
  <link rel="stylesheet" href="__PUBLIC__/script/Plug/bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="__PUBLIC__/script/Plug/bootstrap/css/bootstrap-theme.min.css">
  <script src="__PUBLIC__/script/Common/jquery-1.10.2.js"></script>
  <script src="__PUBLIC__/script/Plug/bootstrap/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="__PUBLIC__/script/Plug/artDialog/dist/sea.js"></script>
  <script type="text/javascript" src="__PUBLIC__/script/Plug/artDialog/dist/dialog-min.js"></script>
</head>
<body> 
  <include file="Course:t_head" active="homeowork-li"/>
  <div class="main">
    
      <div class="pub-area">
          <a href="__CONTROLLER__/downloadAllHomework/homeworkId/{$Think.get.homewokrId}/courseId/{$Think.get.courseId}" class="btn btn-success">打包下载</a>
      </div>
   <table class="table table-hover tableList table-striped table-bordered">
    <tr>
        <th>名字</th>
        <th>提交时间</th>
        <th>操作</th>
    </tr>
      <volist name="homeworkList" id="res">
        <tr>
            <td>{$res.user_name}</td> 
            <td>{$res.pub_time|date="Y-m-d",###}</td>

            <td><a href="__ROOT__/{$res.file_path}" class="btn btn-success btn-sm">下载</a>
            <a href="__MODULE__/Works/previewWork/id/{$res.homework_id}" class="btn btn-success btn-sm" >预览</a>
            <a href="javascript:;" class="btn btn-success btn-sm score" hid={$res.id}>评分</a></td>
        
        </tr>
    </volist>
  </table>
</div>

    <div class="modal fade bs-example-modal-sm homeworkModal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-sm">
        <div class="modal-content" style="width:340px;height:250px;">

       <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title">作业评分</h4>

       </div>
           <div class="input-group" style="margin:20px;">
            <div class="input-group" style="margin:20px;">
              <span class="input-group-addon" id="basic-addon1">评分</span>
              <input type="text" class="form-control validate[required]" placeholder="评分" aria-describedby="basic-addon1" style="width:200px;" name="title" id="score">
            </div>

            <div class="input-group" style="margin:20px;">
              <span class="input-group-addon" id="basic-addon1">评语</span>
              <input type="text" class="form-control validate[required]" placeholder="评语" aria-describedby="basic-addon1" style="width:200px;" name="title" id="comment">
            </div>

            <center>
              <a href="javascript:;" class="btn btn-success scoreSub">提交</a></td>
            </center>

      </div>
    </div>
    </div>
    </div>

     <div class="modal fade bs-example-modal-sm editModal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-sm">
        <div class="modal-content" style="width:340px;height:250px;">

       <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title">作业评分</h4>

       </div>
           <div class="input-group" style="margin:20px;">
            <div class="input-group" style="margin:20px;">
              <span class="input-group-addon" id="basic-addon1">名称</span>
              <input type="text" class="form-control validate[required]" placeholder="评分" aria-describedby="basic-addon1" style="width:200px;" name="title" id="score">
            </div>

            <div class="input-group" style="margin:20px;">
              <span class="input-group-addon" id="basic-addon1">评语</span>
              <input type="text" class="form-control validate[required]" placeholder="评语" aria-describedby="basic-addon1" style="width:200px;" name="title" id="comment">
            </div>

            <center>
              <a href="javascript:;" class="btn btn-success scoreSub">提交</a></td>
            </center>

      </div>
    </div>
    </div>
    </div>
     <div class="modal fade bs-example-modal-sm editModal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-sm">
        <div class="modal-content" style="width:350px;height:320px;">

       <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title">发布作业</h4>

       </div>
          <form id="homework_add">
            <div class="input-group">
              <span class="input-group-addon" id="basic-addon1">作业名称</span>
              <input type="text" name="homework_name" id="homework_name" class="validate[required,maxSize[12]] form-control"> 
            </div>
            <div class="input-group">
              <span class="input-group-addon" id="basic-addon1">作业要求</span>
              <textarea class="form-control" name="homework_about" id="homework_about" rows="3" class="validate[required,maxSize[200] form-control"></textarea>
            </div>
            <div class="input-group">
              <span class="input-group-addon" id="basic-addon1">截止时间</span>
              <input type="text" name="homework_expires" id="homework_expires" class="validate[required] form-control">  
            </div>
            <input type="submit" value="新增作业" class="btn btn-success btn-home">
            <input type="hidden" value="{$Think.get.courseId}" name="course_id">
          </form>
      </div>
    </div>
    </div>
    <div class="modal fade bs-example-modal-sm" id="message" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog modal-sm">
      <div class="modal-content">

        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          <h4 class="modal-title" id="mySmallModalLabel">提示</h4>
        </div>
        <div class="modal-body" style="  text-align: center;line-height: 60px;height: 100px;">
          
        </div>
      </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
  </div><!-- /.modal -->
  <script type="text/javascript">
        $(function(){
          var hid = null;
           $('.score').click(function(){
              hid = $(this).attr('hid');
              $('.homeworkModal').modal(true);
           });

           $('.scoreSub').click(function(){
              var comment = $('#comment').val();
              var score   = $('#score').val();
              var homeworkId   = {$Think.get.homewokrId};
              
              $.post('__CONTROLLER__/t_HomeworkScore',{
                  comment:comment,score:score,homeworkId:homeworkId,hid:hid
                },function(data,staus){
                  $('.homeworkModal').modal('hide');
                    if (data.status == 0 ) {
                        $('#message .modal-body').text(data.message);
                        $('#message').modal(true);
                    }else{
                         $('#message .modal-body').text(data.message);
                         $('#message').modal(true);
                           setTimeout(function(){
                        $('#message').modal('hide');
                        location.reload(true);
                     },1500)
                    };
                }
              )
           })
        })
    </script>
    <!-- <include file="Public:footer" /> -->

</body>
</html>